package org.jjliu.example.action;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.io.IOUtils;
import org.jjliu.example.domain.TestService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.fastjson.JSONObject;

public class Main {

	public static void main(String[] args) {
/*		PythonInterpreter interp = new PythonInterpreter();
		interp.execfile("math.py");
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("m1", "fefe");
		map.put("m2", "fefeff");
		interp.set("map", map);
		PyObject x = interp.eval("add(map)");
//		Object x = interp.get("x");
       System.out.println("x: " + x);
       interp.cleanup();
*//*		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-main.xml");
		final TestService testService = context.getBean(TestService.class);
		new Thread(new Runnable() {
			@Override
			public void run() {
				testService.lock1();
				System.out.println("------1----------");
			}
		}).start();
		new Thread(new Runnable() {
			@Override
			public void run() {
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				testService.lock2();
				System.out.println("-----2-----------");
			}
		}).start();
*/	}

}
